using Sustainalytics.ESG.Entities;
using Sustainalytics.Synchronization.Validation.ValidationRules.Common;

namespace Sustainalytics.Synchronization.Validation.ValidationRules.Comprehensive
{
    public class AnalystCommentaryRule : ComprehensiveRule<RPCompanyProfile>
    {
        public override Severity Severity => Severity.Red;
        public override BusinessResearchProduct BusinessResearchProduct => BusinessResearchProduct.Comprehensive;
        public override string Code => "RR1";
        public override string InformationalMessage => "Analyst Commentary field must have text";

        public AnalystCommentaryRule()
        {
            For(x => x.AnalystCommentary).When((x, y) => !string.IsNullOrWhiteSpace(x.AnalystCommentary)).WithKey(x => x.Id).WithMessage("The company {0} #{1}# does not have analyst commentary");
        }
    }
}